<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>留言</title>
    <link rel="stylesheet" href="layui/css/layui.css">
    <link rel="stylesheet" href="css/home.css">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes"/>
</head>
<body>

<div id="header">
    <div class="nav">
        <a href="#" class="logo">Lee Blog</a>
        <div id="nav-btn" class="btn">
            <i id="btn" class="layui-icon layui-icon-addition"></i>
        </div>
        <ul class="nav-bar">
            <li><a href="home.html" th:href="@{/home}">首页</a></li>
            <li><a href="technology.html" th:href="@{/technology}">技术</a></li>
            <li><a href="life.html" th:href="@{/life}">杂记</a></li>
            <li><a href="time.html" th:href="@{/time}">时间轴</a></li>
            <li class="active"><a href="message.html" th:href="@{/message}">留言</a></li>
            <li><a href="about.html" th:href="@{/about}">关于我</a></li>
        </ul>
    </div>
</div>

<div class="layui-fluid btn-nav">
    <ul>
        <li><a href="home.html" th:href="@{/home}">首页</a></li>
        <li><a href="technology.html" th:href="@{/technology}">技术</a></li>
        <li><a href="life.html" th:href="@{/life}">杂记</a></li>
        <li><a href="time.html" th:href="@{/time}">时间轴</a></li>
        <li class="active"><a href="message.html" th:href="@{/message}">留言</a></li>
        <li><a href="about.html" th:href="@{/about}">关于我</a></li>
    </ul>
</div>


<div class="layui-fluid title">
    <h1>留言</h1>
    <p>我只是悄悄的记录，记录每一个鼓励和建议。</p>
</div>

<div id="edit-message" class="layui-container">
    <form action="" th:action="@{/doMessage}" name="formDemo" class="layui-form" method="post">
        <div class="layui-form-item layui-form-text layui-anim layui-anim-up">
            <label class="layui-form-label">留言内容</label>
            <div class="layui-input-block">
                <textarea id="content" name="content" lay-verify="required|content" placeholder="请输入留言内容" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item layui-anim layui-anim-up">
            <label class="layui-form-label">你的昵称</label>
            <div class="layui-input-block">
                <input type="text" id="name" name="name"  lay-verify="required|name" placeholder="请输入你的昵称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-anim layui-anim-up">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>

<div id="main" class="layui-container">
    <div class="message-item layui-anim layui-anim-up" th:each="message : ${allMessage}">
        <p th:text="${message.content}">我只是悄悄的记录，记录每一个鼓励和建议。我只是悄悄的记录，记录每一个鼓励和建议。
            我只是悄悄的记录，记录每一个鼓励和建议。我只是悄悄的记录，记录每一个鼓励和建议。
            我只是悄悄的记录，记录每一个鼓励和建议。我只是悄悄的记录，记录每一个鼓励和建议。</p>
        <i class="layui-icon layui-icon-user" th:text="${message.name}"> 刘德华</i>
        <i class="layui-icon layui-icon-time" th:text="${message.time}"> 2020年3月24日</i>
    </div>
</div>



<div id="footer"><a href="http://www.beian.miit.gov.cn/">Copyright © 2020 LeeBlog 鄂ICP备20013163号</a></div>


<script src="js/jquery-3.4.1.js"></script>
<script src="js/function.js"></script>
<script src="layui/layui.js"></script>
<script src="js/home.js"></script>
<script src="js/jquery.rotate.min.js"></script>
<script>
    layui.use(["jquery", "form"], function () {
        var $ = layui.jquery;
        var form = layui.form;
        form.verify({
            name: function (value) {
                if(value.length < 2){
                    return "昵称请输入2个字以上哦~";
                }
            },
            content: function (value) {
                if(value.length < 6){
                    return "留言内容请输入6个字以上哦~";
                }
            }
        })
    })
</script>
</body>
</html>